xm: Show usage message of xm commands
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 24 Feb 2010 10:46:49 +0000 (10:46 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 24 Feb 2010 10:46:49 +0000 (10:46 +0000)
The following commands don't show an usage message even if we give
a wrong option to the commands.

 - xm block-list
 - xm network-list
 - xm network2-list
 - xm vtpm-list
 - xm pci-list
 - xm scsi-list

e.g.
 # xm block-list --xxx vm1
 Error: option --xxx not recognized

This patch shows the usage message of the commands.

e.g.
 # xm block-list --xxx vm1
 Error: option --xxx not recognized
 Usage: xm block-list <Domain> [--long]
 List virtual block devices for a domain.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
tools/python/xen/xm/main.py

index 73e868f2cbc29812151bd527352bd1f5811afffd..0c2f942d7903c755dcd9c72ce4b9f3e2f58db433 100644 (file)
@@ -2122,7 +2122,7 @@ def arg_check_for_resource_list(args, name):
         (options, params) = getopt.gnu_getopt(args, 'l', ['long'])
     except getopt.GetoptError, opterr:
         err(opterr)
-        sys.exit(1)
+        usage(name)
 
     for (k, v) in options:
         if k in ['-l', '--long']: